import config from '@/config'
import RequestBase from '@/utils/request.js'

const baseRequest = new RequestBase(config.education)
const safetyRequest = new RequestBase(config.safetyUrl)

// 查询课件资源详情
export function getCoursewareDetail(coursewareId) {
  return baseRequest.get(`/learnGarden/courseware/detail/${coursewareId}`)
}

// 学习
export function coursewareLearn(data) {
  return baseRequest.post(`/learnGarden/courseware/learn`, data)
}

// 学习时长
export function getCoursewareCount() {
  return baseRequest.get(`/learnGarden/courseware/learn/count`)
}

// 学习记录
export function getCoursewareLog() {
  return baseRequest.get(`/learnGarden/courseware/learn/log`)
}

// 查询课件资源列表
export function getCoursewareList(data) {
  return baseRequest.get(`/learnGarden/courseware/list`, data)
}

// 获取课件类型
export function getCourseTypeList() {
  return safetyRequest.get('/bsci/business/type/box/list', {
    businessCategory: 2
  })
}
